'use strict';

const Controller = require('egg').Controller;

class List1Controller extends Controller {
  async index() {
    const ctx = this.ctx;
    const data = {};
    const targetURLNode = ctx.targetURLNode;

    const result = await ctx.service.cms.getContentDetail();
    data.title = `红塔期货-${targetURLNode.urlNode.label}`;
    data.menu = ctx.app.menus;
    data.menuId = targetURLNode.urlNode.id;
    data.sidebarOptions = targetURLNode.nodeArr[targetURLNode.nodeArr.length - 1];
    data.detail = result;
    data.breadcrumb = targetURLNode.nodeArr.reverse();
    await this.ctx.render('/templates/detail2.njk', data);
  }
}

module.exports = List1Controller;
